/*2010404114
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package homework.demo4;

import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/**
 *
 * @author Administrator
 */
public class WriteFileDemo {
    public static void main(String[] args) throws Exception{
        File file=new File("text.txt");
        FileOutputStream f=new FileOutputStream(file,true);
        PrintWriter p=new PrintWriter(f,true);
        p.println("hello");
        System.out.println("已经成功向文件中加添了一个数据");
        
    }

}
